package com.demo;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class NotEmptyValidator implements ConstraintValidator<NotEmpty,String>
{
    @Override
    public void initialize(NotEmpty constraintAnnotation) {}

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context)
    {
        if (value == null) {
            return false;
        } else if (value.length()<1) {
            return false;
        } else {
            return true;
        }
    }
}
